<%-- 
    Document   : userDetails
    Created on : Oct 25, 2012, 1:58:15 PM
    Author     : berto
--%>

<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.DBManager"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.User"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%!
    private DBManager db;
    
    @Override
    public void init() throws UnavailableException{
            db=(DBManager)super.getServletContext().getAttribute("db_manager");
    }
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>User details</title>
	<meta name="title" content="User details"/>
  </head>
  <body>
      <%
           User user=(User)request.getAttribute("user");
      %>
            <div class="content">
                <h2>Details of user: <%=user.getUsername()%></h2>
                <!-- 
                A questa pagina passo l'oggetto utente con metodo post in modo che sono 
                piu' comodo a caricarlo, oppure come variabile di sessione.
                L'utente lo seleziono dal filter che sara attivato alla richiesta di
                questa pagina.
                -->
            <table>
                <tr>
                    <td>Username:</td>
                    <td><%=user.getUsername()%>
                    </td>
                </tr>
                <tr>
                    <td>Email:</td>
                    <td><%=user.getEmail()%>
                    </td>
                </tr>
                <tr>
                    <td>First name:</td>
                    <td><%=user.getFirst_name()%>
                    </td>
                </tr>
                <tr>
                    <td>Last name:</td>
                    <td><%=user.getLast_name()%>
                    </td>
                </tr>
                <tr>
                    <td>Birth of date:</td>
                    <td><%=user.getBirthdateHuman()%>
                    </td>
                </tr>
                <tr>
                    <td>Address:</td>
                    <td><%=user.getAddress()%>
                    </td>
                </tr>
                <tr>
                    <td>Registered at:</td>
                    <td><%=user.getRegister_at()%>
                    </td>
                </tr>
            </table>
            </div>
</body>
</html>
